package com.example.lwp.webdemo.controller;
import java.util.Date;
import java.util.Optional;
import java.util.function.Supplier;

import com.example.lwp.webdemo.model.Person;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.validator.internal.constraintvalidators.hv.pl.PESELValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hello")
@Slf4j
public class HelloController {

    @GetMapping("/hello")
    public String hello(String name) {
        return "hello " + name;
    }

    @PostMapping("/test")
    public String test(@RequestBody Person person) {
        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");
        System.out.println(person);
        return "hello " + person;
    }

}
